package com.huijy.management.service.impl;

import java.util.List;

import com.huijy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.huijy.management.mapper.ShopMapper;
import com.huijy.management.domain.Shop;
import com.huijy.management.service.IShopService;

/**
 * 商铺管理Service业务层处理
 *
 * @author luobo
 * @date 2021-09-12
 */
@Service
public class ShopServiceImpl implements IShopService {
    @Autowired
    private ShopMapper shopMapper;

    /**
     * 查询商铺管理
     *
     * @param shopId 商铺管理主键
     * @return 商铺管理
     */
    @Override
    public Shop selectShopByShopId(Long shopId) {
        return shopMapper.selectShopByShopId(shopId);
    }

    /**
     * 查询商铺管理列表
     *
     * @param shop 商铺管理
     * @return 商铺管理
     */
    @Override
    public List<Shop> selectShopList(Shop shop) {
        return shopMapper.selectShopList(shop);
    }

    /**
     * 新增商铺管理
     *
     * @param shop 商铺管理
     * @return 结果
     */
    @Override
    public int insertShop(Shop shop) {
        shop.setCreateTime(DateUtils.getNowDate());
        return shopMapper.insertShop(shop);
    }

    /**
     * 修改商铺管理
     *
     * @param shop 商铺管理
     * @return 结果
     */
    @Override
    public int updateShop(Shop shop) {

        return shopMapper.updateShop(shop);
    }

    /**
     * 批量删除商铺管理
     *
     * @param shopIds 需要删除的商铺管理主键
     * @return 结果
     */
    @Override
    public int deleteShopByShopIds(Long[] shopIds) {
        return shopMapper.deleteShopByShopIds(shopIds);
    }

    /**
     * 删除商铺管理信息
     *
     * @param shopId 商铺管理主键
     * @return 结果
     */
    @Override
    public int deleteShopByShopId(Long shopId) {
        return shopMapper.deleteShopByShopId(shopId);
    }

    @Override
    public List<Shop> getListByMemberId(Long memberId) {
        return shopMapper.selectListByMemberId(memberId);
    }

    @Override
    public List<Shop> selectShopByHotel(Shop shop) {
        return shopMapper.selectShopByHotel(shop);
    }
}
